package com.pms.web;

import java.io.IOException;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.pms.entity.Employee;
import com.pms.entity.Project;
import com.pms.service.ProjectService;

public class HomeServlet extends HttpServlet {

	private static final long serialVersionUID = 1L;

	@Override
	protected void service(HttpServletRequest request, HttpServletResponse response)
			throws ServletException, IOException {
		HttpSession session=request.getSession();
		Employee employee=(Employee) session.getAttribute("session_employee");
		
		String employeeid=employee.getId();
		ProjectService ps=new ProjectService();
		
		List<Project> plist=ps.findProject(employeeid);
		request.setAttribute("projectlist", plist);
		request.getRequestDispatcher("WEB-INF/views/home.jsp").forward(request, response);
	}

}
